package xyz.zhzby.cyzx.acl.service;

import xyz.zhzby.cyzx.acl.dto.request.RolePageRequest;
import xyz.zhzby.cyzx.acl.dto.response.RoleResponse;
import xyz.zhzby.cyzx.acl.entity.Role;
import com.baomidou.mybatisplus.extension.service.IService;
import xyz.zhzby.cyzx.servicebase.domain.PageResponse;
import xyz.zhzby.cyzx.servicebase.domain.RestResponse;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 角色表 服务类
 * </p>
 *
 * @author zby
 * @since 2021-12-07
 */
public interface IRoleService extends IService<Role> {

    //根据用户获取角色数据
    RestResponse<Map<String, Object>> findRoleByUserId(Long userId);

    //根据用户分配角色
    void saveUserRoleRealtionShip(Long userId, Long[] roleId);

    List<Role> selectRoleByUserId(Long id);

    RestResponse<PageResponse<RoleResponse>> queryRoles(RolePageRequest pageRequest);

    RestResponse<String> saveRole(Role role);

    RestResponse<String> removeRole(Long roleId);

    RestResponse<RoleResponse> getOneById(Long roleId);

    RestResponse<String> updateOne(Role role);

    RestResponse<String> removeRoleBatch(List<Long> ids);
}
